package com.homework5;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class demo {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream("D:\\a1.txt"),"GBK");
        outputStreamWriter.write("我爱Java");
        outputStreamWriter.close();

    }
}